<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
	<link rel="stylesheet" type="text/css" href="../css/aui.css" />
	<link rel="stylesheet" type="text/css" href="../css/style.css"/>
</head>
<body>
<header class="aui-navBar aui-navBar-fixed"  id="aui-header">
	<a  onclick="closeWin()" class="aui-navBar-item"  >
		<i class="icon icon-back"></i>
	</a>
	<div class="aui-center">
		<span class="aui-center-title"   id="title" style="background: linear-gradient(to right, red, blue); -webkit-background-clip: text; color: transparent;" >  在线客服</span>
	</div>

	<a  onclick="clearR()" class="aui-navBar-item" style="color: #725f5f;"  >
		<i class="icon"></i>
	</a>

</header>


</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
    apiready = function(){
        //后台获取客服H5连接
        api.ajax({
            url:  'http://124.222.162.204:1002/login/login/kefuh5.html',
            method: 'get',
            data: {
                values: {
                    mike_key: localStorage.getItem('mike_key')
                }
            }
        }, function (ret, err) {
            if (ret) {
                var douyinurl=ret.msg['h5_url'];
                api.parseTapmode();
                var header = $api.byId('aui-header');
                $api.fixStatusBar(header);
                var headerPos = $api.offset(header);
                var body_h = $api.offset($api.dom('body')).h;
                api.openFrame({
                    name: 'douyinduanshipin',
                    url: douyinurl,
                    bounces: true,
                    bgColor: '#fffae4',
                    rect: {
                        x: 0,
                        y: headerPos.h,
                        w: 'auto',
                        h: 'auto'
                    },
                    pageParam: {}
                })

            } else {
                alert('网络错误！');
                return;
            }
        });

    }


    function closeWin(){
        api.closeWin({
        });
    }
</script>
</html>
